home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / domacnost a kancelar / autoit / autoit-v3-setup.exe / Examples / Helpfile / BitRotate.au3 < prev    next >
Text File  |  2007-09-08  |  356b  |  9 lines

  1. $x = BitRotate(7, 2)
  2. ;  x == 3 because 111b left-rotated twice is 1 1100b == 28
  3.  
  4. $y = BitRotate(14, -2)
  5. ;  y == 32771 because 1110b right-rotated twice on 16 bits is 1000 0000 0000 0011b == 32771
  6.  
  7. $z = BitRotate(14, -2, "D")
  8. ;  z == -2147483645 because 1110b right-rotated twice on 16 bits is 1000 0000 0000 0000 0000 0000 0000 0011b == 2147483645
  9.